package com.example.pagedemo.controller;

import com.example.pagedemo.domain.Major;
import com.example.pagedemo.utils.page.TableDataInfo;
import com.example.pagedemo.mapper.PageDemoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import com.example.pagedemo.utils.controller.BaseController;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class PageDemoController extends BaseController {

    @Autowired
    private PageDemoMapper pageDemoMapper;

    @GetMapping("/page")
    public TableDataInfo list() {
        startPage();
        List<Major> list = pageDemoMapper.selectMajorList();
        return getDataTable(list);
    }
}
